package com.example.teamwork3.Mapper;

import com.example.teamwork3.Model.Kselectsub;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface KselectsubMapper {

    @Select("SELECT kselectsub.* from kselectsub WHERE kselectsub.isarmy='是'")//退伍军人特殊处理
    List<Kselectsub> SelectKselectsubByArmy();

    @Select("SELECT kselectsub.*,grade.`名次` AS 'num' from kselectsub,grade WHERE kselectsub.stunum = grade.stu_id AND kselectsub.isarmy='否'")//查询除了退伍军人之外的其他人信息
    List<Kselectsub> SelectKselectsub();


    @Update("UPDATE `teamwork3`.`kselectsub` SET `subject` = #{subject} WHERE `id` = #{id}")//更改分流专业
    void UpdateSubjectById(String subject,int id);

    @Update("UPDATE `teamwork3`.`kselectsub` SET `ruleid` = #{ruleid} WHERE `id` = #{id}")//更改规则
    void UpdateRuleidById(String ruleid,int id);
}
